package org.example.ruoxing_admin_springboot3.controller.user;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import org.example.ruoxing_admin_springboot3.dto.UserLoginIframeSSODto;
import org.example.ruoxing_admin_springboot3.httpResponseResult.ResponseResult;
import org.example.ruoxing_admin_springboot3.service.user.UserLoginSSOService;
import org.example.ruoxing_admin_springboot3.service.user.UserLoginService;
import org.example.ruoxing_admin_springboot3.dto.UserInfoDto;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
/**
 * @description 用户登陆的接口
 * @author 莫若省
 * @createTime 2024/4/29
 */
@Tag(name = "用户登陆相关接口")
@RestController
public class UserLoginController {
    @Resource
    UserLoginService userLoginService;
    @Operation(summary = "用户登陆的接口")
    @PostMapping("/login")
    public ResponseResult<Object> login(@RequestBody UserInfoDto userInfo) {
        return userLoginService.userLogin(userInfo);
    }
    @Resource
    UserLoginSSOService userLoginSSOService ;
    @Operation(summary = "单点登陆的接口")
    @PostMapping("/login_sso")
    public ResponseResult<Object> ssoLogin(@RequestBody UserLoginIframeSSODto userLoginSSODto) {
        return userLoginSSOService.userLogin(userLoginSSODto);
    }
}
